#include "VDialogRemove.h"
#include <qdebug.h>



VDialogRemove::VDialogRemove()
{
	

	// button
	_btn_ok = new QPushButton("确定");
	_btn_cancel = new QPushButton("取消");

	_chile_layout = new QHBoxLayout();  
	_chile_layout->addStretch();
	_chile_layout->addWidget(_btn_ok);
	_chile_layout->addWidget(_btn_cancel);

	_checkbox = new QCheckBox("同时删除文件");
	
	_main_layout = new QVBoxLayout();
	_main_layout->addWidget(_checkbox);
	_main_layout->addLayout(_chile_layout);

	this->setWindowTitle("移除模块");
	this->resize(300, 150);

	connect(_btn_ok, &QPushButton::clicked, this, &VDialogRemove::on_btn_ok_clicked);
	connect(_btn_cancel, &QPushButton::clicked, this, &VDialogRemove::on_btn_cancel_clicked);

	this->setLayout(_main_layout);
	
}


VDialogRemove::~VDialogRemove()
{
}

void VDialogRemove::on_btn_ok_clicked()
{
	_delete_source_file = this->_checkbox->isChecked();
	this->accept();
}

void VDialogRemove::on_btn_cancel_clicked()
{
	this->reject();
}
